package main

import (
	"com.cyt.common/grpc/pb"
	"com.cyt.common/library/servicediscov/etcd"
	"context"
	"fmt"
)

func main() {
	addrs := []string{"127.0.0.1:2379"}
	conn, err := etcd.NewClient(addrs, "hello.rpc")
	if err != nil {
		panic(err)
	}
	helloClient := pb.NewGreeterClient(conn)
	res, err := helloClient.SayHello(context.Background(), &pb.HelloRequest{
		Name: "test rpc",
	})
	if err != nil {
		fmt.Println(err)
	}
	fmt.Println(res)
}
